home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / samples / Multimedia / Direct3D / Billboard / readme.txt < prev    next >
Encoding:
Text File  |  2001-10-10  |  2.8 KB  |  63 lines

  1. //-----------------------------------------------------------------------------
  2. // Name: Billboard Direct3D Sample
  3. // 
  4. // Copyright (c) 1998-2001 Microsoft Corporation. All rights reserved.
  5. //-----------------------------------------------------------------------------
  6.  
  7.  
  8. Description
  9. ===========
  10.    The Billboard sample illustrates the billboarding technique. Rather than
  11.    rendering complex 3D models (such as a high-polygon tree model),
  12.    billboarding renders a 2D image of the model and rotates it to always face
  13.    the eyepoint. This technique is commonly used to render trees, clouds,
  14.    smoke, explosions, and more. For more information, see 
  15.    Common Techniques and Special Effects.
  16.  
  17.    The sample has a camera fly around a 3D scene with a tree-covered hill. The
  18.    trees look like 3D objects, but they are actually 2-D billboarded images
  19.    that are rotated towards the eye point. The hilly terrain and the skybox 
  20.    (6-sided cube containing sky textures) are just objects loaded from .x
  21.    files, used for visual effect, and are unrelated to the billboarding
  22.    technique.
  23.    
  24. Path
  25. ====
  26.    Source:     DXSDK\Samples\Multimedia\D3D\Billboard
  27.    Executable: DXSDK\Samples\Multimedia\D3D\Bin
  28.  
  29.  
  30. User's Guide
  31. ============
  32.    The following keys are implemented. The dropdown menus can be used for the
  33.    same controls.
  34.       <Enter>     Starts and stops the scene
  35.       <Space>     Advances the scene by a small increment
  36.       <F1>        Shows help or available commands.
  37.       <F2>        Prompts user to select a new rendering device or display mode
  38.       <Alt+Enter> Toggles between fullscreen and windowed modes
  39.       <Esc>       Exits the app.
  40.     
  41.  
  42. Programming Notes
  43. =================
  44.    The billboarding technique is the focus of this sample. Each frame, the
  45.    camera is moved, so the viewpoint changes accordingly. As the viewpoint
  46.    changes, a rotation matrix is generated to rotate the billboards about
  47.    the y-axis so that they face the new viewpoint. The computation of the 
  48.    billboard matrix occurs in the FrameMove() function. The trees are also
  49.    sorted in that function, as required for proper alpha blanding, since 
  50.    billboards typically have some transparent pixels. The trees are 
  51.    rendered from a vertex buffer in the DrawTrees() function.
  52.    
  53.    Note that the billboards in this sample are constrained to rotate about the 
  54.    y-axis only, as otherwise the tree trunks would appear to not be fixed to 
  55.    the ground. In a 3D flight sim or space shooter, for effects like 
  56.    explosions, billboards are typically not constrained to one axis.
  57.    
  58.    This sample makes use of common DirectX code (consisting of helper functions,
  59.    etc.) that is shared with other samples on the DirectX SDK. All common
  60.    headers and source code can be found in the following directory:
  61.       DXSDK\Samples\Multimedia\Common
  62.  
  63.